package sniff.pack;

import control.SystemControl;
import control.SystemUIControl;

public class MyARPPacket extends CommonPacket {
	private int hlen;
	private int plen;
	private String htype;
	private String protocolType;
	private String operation;
	private String senderMac;
	private String senderIP;
	private String targetMac;
	private String targetIP;
	private String padding;

	public MyARPPacket(String destinationMAC, String sourceMAC, String protocol, String htype, String protocolType, int hlen,
			int plen, String operation, String senderMac, String senderIP, String targetMac, String targetIP,
			String padding, int lenght, String info, byte[] head,byte[] data) {
		super(sourceMAC, destinationMAC, protocol, lenght, info, head,data);
		this.hlen = hlen;
		this.plen = plen;
		this.htype = htype;
		this.protocolType = protocolType;
		this.operation = operation;
		this.senderMac = senderMac;
		this.senderIP = senderIP;
		this.targetMac = targetMac;
		this.targetIP = targetIP;
		this.padding = padding;
	}

	public MyARPPacket() {
		super();
	}

	public int getHlen() {
		return hlen;
	}

	public void setHlen(int hlen) {
		this.hlen = hlen;
	}

	public int getPlen() {
		return plen;
	}

	public void setPlen(int plen) {
		this.plen = plen;
	}

	public String getHtype() {
		return htype;
	}

	public void setHtype(String htype) {
		this.htype = htype;
	}

	public String getProtocolType() {
		return protocolType;
	}

	public void setProtocolType(String protocolType) {
		this.protocolType = protocolType;
	}

	public String getOperation() {
		return operation;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

	public String getSenderMac() {
		return senderMac;
	}

	public void setSenderMac(String senderMac) {
		this.senderMac = senderMac;
	}

	public String getSenderIP() {
		return senderIP;
	}

	public void setSenderIP(String senderIP) {
		this.senderIP = senderIP;
	}

	public String getTargetMac() {
		return targetMac;
	}

	public void setTargetMac(String targetMac) {
		this.targetMac = targetMac;
	}

	public String getTargetIP() {
		return targetIP;
	}

	public void setTargetIP(String targetIP) {
		this.targetIP = targetIP;
	}

	public String getPadding() {
		return padding;
	}

	public void setPadding(String padding) {
		this.padding = padding;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append(super.toString());
		sb.append(SystemUIControl.SPLITSTRING+"\n");
		sb.append("Hardware Type:"+this.htype+"\n");
		sb.append("Padding:"+this.padding+"\n");
		sb.append("Protocol Type:"+this.protocolType+"\n");
		sb.append("Hareware size:"+this.hlen+"\n");
		sb.append("Protocol size:"+this.plen+"\n");
		sb.append("Opreation:"+this.operation+"\n");
		sb.append("Sender MAC Address:"+this.senderMac+"\n");
		sb.append("Sender IP Address:"+this.senderIP+"\n");
		sb.append("Target MAC Address:"+this.targetMac+"\n");
		sb.append("Targer IP Address:"+this.targetIP+"\n");
		return sb.toString();
	}

}
